<?php

/*
 * |--------------------------------------------------------------------------
 * | Web Routes
 * |--------------------------------------------------------------------------
 * |
 * | Here is where you can register web routes for your application. These
 * | routes are loaded by the RouteServiceProvider within a group which
 * | contains the "web" middleware group. Now create something great!
 * |
 */
use Illuminate\Support\Facades\Route;

/*******************
 * ログイン
 * ****************/
Route::get('/', function () {
    return view('login');
});
Route::get('/login', function () {
    return view('login');
});
Route::post('/login',  'LoginController@doLogin');

Route::get('/pschange',function () {
    return view('/pschange');
});
Route::post('/pschange/create',  'PschangeController@doPschange');


/*******************
 * 顧客
 * ****************/
// トップ画面
Route::get('/customer/home',  'Customer\HomeController@index')->name('customer.home');

// 商品詳細
Route::get('/customer/goods_detail',  'Customer\GoodsDetailController@index')->name('customer.goods_detail');
// 在庫照会
Route::get('/customer/goods_stock_inquiry',  'Customer\GoodsDetailController@gotoSockInquiry')->name('customer.goods_stock_inquiry');


// TODO:機能実装、現状はタブテスト用なので未実装
// 発注履歴
Route::get('/customer/order_history',  'Customer\JapanOrderHistoryController@order_history')->name('customer.order_history');
// 発注状況
Route::get('/customer/order_situation', 'Customer\JapanOrderSituationController@order_situation')->name('customer.order_situation');
// 発注残照会
Route::get('/customer/order_remaining','Customer\JapanOrderRemainingController@order_remaining')->name('customer.order_remaining');
//购物车下单
Route::get('/customer/cart_buy','Customer\JapanCartBuyController@index')->name('customer.cart_buy');
// サイズ交換依頼
Route::get('/customer/size_exchange', 'Customer\JapanSizeExchangeController@size_exchange')->name('customer.size_exchange');
// 登録情報変更
Route::get('/customer/customer_info_change', 'Customer\UserInfoController@customer_info_change')->middleware('checkCustomer')->name('customer.customer_info_change');
// 請求書ダウンロード
Route::get('/customer/invoice_download','Customer\JapanInvoiceDownloadController@invoice_download')->name('customer.invoice_download');



// 会社マスタ
Route::post('/admin/corp/create',  'Admin\CorpController@addCorpMaster');
Route::post('/admin/corp/delete',  'Admin\CorpController@delCorpMaster');
Route::get('/admin/corp','Admin\CorpController@queryCorpMaster')->name('admin.corp_list');
Route::get('/admin/home',  'Admin\HomeController@index')->name('admin.home');
Route::post('/admin/corplist/create','Admin\CorpController@index')->name('admin.corp_master');
Route::post('/admin/corplist/delete','Admin\CorpController@delcorpInfo');
Route::post('/admin/corplist/csv', 'Admin\CorpController@inputCsvCorpMaster');

Route::get('/admin/sale_master', function() {
    return view('admin.sale_master');
})->name('admin.sale_master');


// セール品マスタ
Route::get('/admin/sale_master', 'Admin\SaleController@index')->name('admin.sale_master');
Route::get('/admin/sale_add', 'Admin\SaleController@showAddSaleView')->name('admin.sale_add');
Route::post('/admin/sale_get_goods', 'Admin\SaleController@getGoodsByCategoryId');
Route::post('/admin/sale/create',  'Admin\SaleController@addSaleGoodsMaster');
Route::post('/admin/sale/delete',  'Admin\SaleController@deleteSaleMaster');
Route::post('/admin/sale/update',  'Admin\SaleController@updateSaleMaster');
Route::post('/admin/sale/addupdate',  'Admin\SaleController@updateSale');
Route::post('/admin/deleteCondictionJson', 'Admin\SaleController@deleteSaleCondictionJson');

// セットマスタ
Route::get('/admin/set', 'Admin\SetController@index')->name('admin.set');

Route::post('/admin/set/create',  'Admin\SetController@addSetGoodsMaster');
Route::post('/admin/set/delete',  'Admin\SetController@delAddSetView');
Route::post('/admin/set/update',  'Admin\SetController@updateSetView');
Route::post('/admin/setjson', 'Admin\SetController@indexJson');
Route::get('/admin/set_add', 'Admin\SetController@showAddSetView')->name('admin.set_add');

// セットing マスタ
Route::get('/admin/setgoods', 'Admin\SettingController@index')->name('admin.setgoods');
Route::get('/admin/setting/create',  'Admin\SettingController@saveSettingMaster');
Route::post('/admin/setting/delete',  'Admin\SettingController@deleteSettingMaster');
Route::get('/admin/setting/update',  'Admin\SettingController@updateSettingMaster');
Route::post('/admin/setting/commitupdate',  'Admin\SettingController@saveUpdateSettingMaster');

//Goods マスタ
Route::get('/admin/goods',  'Admin\GoodsController@doQuery')->name('admin.goods_list');
Route::post('/admin/goods/create','Admin\GoodsController@doSelect')->name('admin.goods_master');
Route::post('/admin/goods/save',  'Admin\GoodsController@doSave');
Route::post('/admin/goods/imgUpload',  'Admin\GoodsController@imgUpload');
Route::post('/admin/goods/delete',  'Admin\GoodsController@doDelete');
Route::post('/admin/goods/csv',  'Admin\GoodsController@doCsv');
Route::post('/admin/goods/getGoods',  'Admin\GoodsController@getGoods');
Route::post('/admin/checkJson', 'Admin\GoodsController@goodsCodeJson');
Route::post('/admin/deleteJson', 'Admin\GoodsController@goodsDeleteJson');


 //仕入れ先
Route::get('/admin/supplier','Admin\SupplierController@index')->name('admin.supplier_master');
Route::post('/admin/supplier/create',  'Admin\SupplierController@addSupplierMaster');
Route::post('/admin/supplier/delete',  'Admin\SupplierController@delSupplierMaster');
Route::post('/admin/supplier/csv', 'Admin\SupplierController@inputCsvSupplierMaster');

//仕入れ先一覧
Route::get('/admin/supplier','Admin\SupplierController@querySupplierMaster')->name('admin.supplier_list');
Route::post('/admin/supplierlist/create','Admin\SupplierController@index')->name('admin.supplier_master');
Route::post('/admin/supplierlist/delete','Admin\SupplierController@delsupplierInfo');



//店舗マスタ
Route::post('/admin/shop/save',  'Admin\ShopController@addShopMaster');
Route::post('/admin/shop/delete',  'Admin\ShopController@delShopMaster');
Route::get('/admin/shoplist','Admin\ShopController@queryShopMaster')->name('admin.shoplist');


Route::post('/admin/shoplist/create','Admin\ShopController@index')->name('admin.shop_master');
Route::post('/admin/shoplist/delete','Admin\ShopController@delshopInfo');
Route::post('/admin/shoplist/csv','Admin\ShopController@inputCsvShopMaster');


//カテゴリーマスタ//
Route::get('/admin/category','Admin\CategoryController@index')->name('admin.category_master');
Route::get('/admin/category_tree','Admin\CategoryTreeController@tree')->name('admin.category_tree');
Route::post('/admin/category/save',  'Admin\CategoryController@addCategoryMaster');
Route::post('/admin/category/delete',  'Admin\CategoryController@delCategoryMaster');
Route::post('/admin/category/csv', 'Admin\CategoryController@inputCsvCategoryMaster');



//ユーザーマスタ
Route::post('/admin/user/create', 'Admin\UserEditController@showUser')->name('admin.user_detail');
Route::post('/admin/user/save',  'Admin\UserEditController@saveUser')->name('admin.user_detail');
Route::post('/admin/user/delete',  'Admin\UserListController@delUser')->name('admin.user_list');
Route::get('/admin/user','Admin\UserListController@index')->name('admin.user_list');
Route::post('/admin/user/checkUname',  'Admin\UserEditController@checkUserMaster');

//価格設定マスタ
Route::get('/admin/setprice','Admin\PriceSettingController@index')->name('admin.pricesetting_master');
Route::post('/admin/setprice/save',  'Admin\PriceSettingController@savePrice');
Route::post('/admin/setprice/delete',  'Admin\PriceSettingController@delPrice');
Route::post('/admin/setprice/getGrpId',  'Admin\PriceSettingController@getPriceByGrpId');


// 在庫照会 wearの場合
Route::get('/customer/goods_stock_wear',  'Customer\GoodsWearController@index')->name('customer.goods_stock_wear');

//会社選択
Route::get('/admin/select_corp','Admin\SelectCorpController@index')->name('admin.select_corp');
Route::get('/admin/goto_home','Admin\SelectCorpController@goto_home');
Route::post('/admin/corp/save_staff',  'Admin\CorpController@saveStaff');


Route::post('/admin/corp/delete_staff',  'Admin\CorpController@deleteStaff');
Route::post('/admin/corp/getStaffs', 'Admin\CorpController@getStaffs');

//商品価格設定マスタ
//会社選択
Route::get('/admin/select_corp_price','Admin\SelectCorpController@indexPrice')->name('admin.select_corp_price');
Route::post('/admin/goto_price','Admin\SelectCorpController@goto_price');

Route::post('/admin/goodsprice/save',  'Admin\GoodsPriceController@addGoodPrice');
Route::post('/admin/goodsprice/getGoods',  'Admin\GoodsPriceController@getGoodsByCateId');
Route::post('/admin/goodsprice/getGoods/{cateId}',  'Admin\GoodsPriceController@getGoodsByCateId');

Route::post('/admin/goodspricelist/create',  'Admin\GoodsPriceController@index')->name('admin.goods_price_master');
Route::post('/admin/goodspricelist/delete',  'Admin\GoodsPriceController@delGoodPrice');
Route::get('/admin/goods_pricelist','Admin\GoodsPriceController@queryGoodPrice')->name('admin.goods_price');
Route::post('/admin/goodspricelist/inputCsv',  'Admin\GoodsPriceController@inputCsv');

// ニュース 情報
Route::get('/admin/news', 'Admin\NewsController@index')->name('admin.news');
Route::post('/admin/news/create','Admin\NewsController@saveNews');
Route::post('/admin/news/delete',  'Admin\NewsController@deleteNews');
Route::post('/admin/news/update',  'Admin\NewsController@updateNews');






//帳票出力
Route::get('/admin/stock_list','Admin\JapanStorehouseController@show_storehouse')->name('admin.stock_list');
Route::get('/admin/delivery_list','Admin\JapanDeliveryController@delivery_list')->name('admin.delivery_list');
Route::get('/admin/invoice','Admin\JapanInvoiceController@invoice_list')->name('admin.invoice_list');
Route::get('/admin/invoice_process','Admin\JapanInvoiceProcessController@invoice_process')->name('admin.invoice_process');
Route::get('/admin/invoice_edit','Admin\JapanInvoiceEditController@invoice_edit')->name('admin.invoice_edit');
Route::get('/admin/buy','Admin\JapanBuyController@buy')->name('admin.buy');
Route::get('/admin/retain','Admin\JapanRetainController@retain_list')->name('admin.retain_list');
Route::get('/admin/bill','Admin\JapanBillController@bill_list')->name('admin.bill_list');
Route::get('/admin/sail_list','Admin\JapanSailController@sail_list')->name('admin.sail_list');
Route::get('/admin/notpaied_list','Admin\JapanNotpaiedController@notpaied_list')->name('admin.notpaied_list');
Route::get('/admin/shop_seil_list','Admin\JapanShopSeilController@shop_seil_list')->name('admin.shop_seil_list');
Route::get('/admin/goods_seil_rank','Admin\JapanGoodsSeilController@goods_seil_rank')->name('admin.goods_seil_rank');
Route::get('/admin/order','Admin\JapanOrderController@order')->name('admin.order');
Route::get('/admin/arrival','Admin\JapanArrivalController@arrival')->name('admin.arrival');
Route::get('/admin/income_money','Admin\JapanIncomeMoneyController@income_money')->name('admin.income_money');
Route::get('/admin/show_stock','Admin\JapanShowStockController@show_stock')->name('admin.show_stock');
Route::get('/admin/show_order','Admin\JapanShowOrderController@show_order')->name('admin.show_order');
Route::get('/admin/show_bay','Admin\JapanShowBayController@show_bay')->name('admin.show_bay');
Route::get('/admin/show_delivery','Admin\JapanShowDeliveryController@show_delivery')->name('admin.show_delivery');
Route::get('/admin/ship','Admin\JapanShipController@ship')->name('admin.ship');
Route::get('/admin/tack_down','Admin\JapanTackDownController@tack_down')->name('admin.tack_down');
Route::get('/admin/eval_change','Admin\JapanEvalChangeController@eval_change')->name('admin.eval_change');
Route::get('/admin/invoice_detail','Admin\JapanInvoiceDetailController@invoice_detail')->name('admin.invoice_detail');

Route::any('/admin/get_data','Base\BaseController@getDbOne');
Route::any('/admin/test','Base\BaseController@test');

Route::any('/admin/use_catget_goods','Admin\AjaxDataController@useCatgetGoods');
Route::any('/admin/get_goods_info','Admin\AjaxDataController@getGoodsInfo');
Route::any('/admin/get_shop_list','Admin\AjaxDataController@getShopMasterList');
Route::any('/admin/get_shop_info','Admin\AjaxDataController@getShopMasterInfo');
Route::any('/admin/save_order','Admin\AjaxDataController@saveOrder');
Route::any('/admin/save_subscribe_order','Admin\AjaxDataController@saveSubscribeOrder');
Route::any('/admin/get_suppiler_order_list','Admin\AjaxDataController@getSuppilerOrderList');
Route::any('/admin/suppiler_goods_in_house','Admin\AjaxDataController@suppilerGoodsInHouse');
Route::any('/admin/get_user_order_detailed_list','Admin\AjaxDataController@getUserOrderDetailedList');
Route::any('/admin/user_out_goods_from_house','Admin\AjaxDataController@userOutGoodsFromHouse');
Route::any('/admin/save_edit_order','Admin\AjaxDataController@saveEditOrder');
Route::any('/admin/set_order_in_money','Admin\AjaxDataController@setOrderInMoney');
Route::any('/admin/take_stock','Admin\AjaxDataController@takeStock');
Route::any('/admin/get_size_arr','Admin\AjaxDataController@getSizeArr');
Route::any('/admin/get_model_info','Admin\AjaxDataController@getModelInfo');
Route::any('/admin/user_size_get_goods_num','Admin\AjaxDataController@userSizeGetGoodsNum');
Route::any('/admin/get_category_info','Admin\AjaxDataController@getCategoryInfo');
Route::any('/admin/save_category','Admin\AjaxDataController@saveCategory');
Route::any('/admin/del_category','Admin\AjaxDataController@delCategory');
Route::any('/admin/upload_csv','Admin\AjaxDataController@uploadCsv');

Route::any('/customer/customer_info_save','Customer\AjaxCustomerDataController@customerInfoSave');
Route::any('/customer/change_pwd','Customer\AjaxCustomerDataController@changePwd');
Route::any('/customer/goods_to_cat','Customer\AjaxCustomerDataController@goodsToCat');
Route::any('/customer/del_cart_goods','Customer\AjaxCustomerDataController@delCartGoods');
Route::any('/customer/save_order','Customer\AjaxCustomerDataController@saveOrder');
Route::any('/customer/change_order','Customer\JapanSizeExchangeController@change_order');

Route::any('/admin/export_csv','ExcelController@export');
Route::any('/admin/import_csv','ExcelController@import');
//売上一覧Exp
Route::any('/admin/exp_sail_list','ExcelController@exp_sail_list');
//出荷一覧Exp
Route::any('/admin/exp_delivery_list','ExcelController@exp_delivery_list');
//未入金一覧
Route::any('/admin/exp_notpaied_list','ExcelController@exp_notpaied_list');
//商品/カテゴリー別売上一覧
Route::any('/admin/exp_goods_seil_rank','ExcelController@exp_goods_seil_rank');